package com.sercomm.ott.mediaplayer.viewpager_test.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

/**
 * Created by davis on 17-10-30.
 */

public class TabFragmentAdapter extends FragmentPagerAdapter{
    private Fragment[] fragments;

    public TabFragmentAdapter(FragmentManager fm,Fragment[] fragments){
        super(fm);
        this.fragments = fragments;
    }
    @Override
    public Fragment getItem(int position){
        return fragments[position % fragments.length];
    }
    @Override
    public int getCount(){
        return fragments.length;
    }
    @Override
    public void destroyItem(ViewGroup container,int position,Object object){

    }

}
